//
//  AccountModel.swift
//  NDAi
//
//  Created by 丸子 on 2024/6/27.
//

import UIKit

struct AccountModel: TableObject {
    static var tableName: String = "AccountModel"
    var userLoginAuthorityId:Int? // 用户登录权限ID
    var loginPhone:loginTypeModel? // 登录电话
    var token:String? // 令牌
    var icon:String? // 图标
    var isLogin:Bool? // 是否登录
    var mobile:String? // 手机号码
    var loginEmail:[[String:Any]]? // 登录邮箱
    var email:String? // 邮箱
    var systemTime:String? // 系统时间
    var isFirst:Bool? // 是否是第一次
    var phone:String? // 电话
    var sex:String? // 性别
    var userId:Int? // 用户ID
    var isInitTourist:Bool? // 是否初始化游客
    var nickname:String?
     
    var userOtherInfo:userOtherInfo?
    enum CodingKeys: String, CodingTableKey {
        typealias Root = AccountModel
        static let objectRelationalMapping = TableBinding(CodingKeys.self)
        case userLoginAuthorityId
        case loginPhone
        case token
        case icon
        case isLogin
        case mobile
//        case loginEmail
        case email
        case systemTime
        case isFirst
        case phone
        case sex
        case userId
        case isInitTourist
        case nickname
        case userOtherInfo
//        case id
//        case customer_reg_source
//        case sts
//        case chat_count
//        case image_count
//        case score
//        case app_channel
//        case vip_end_time
//        case ad_channel
//        case is_vip
//        case vip_start_time
//        case oaid
//        case update_time
//        case wechat_unionid
//        case create_time
//        case wechat
        
        
        static var columnConstraintBindings: [CodingKeys: ColumnConstraintBinding]? {
            return [
                userId: ColumnConstraintBinding(isAutoIncrement: false)
            ]
        }
    }
}
  

struct userOtherInfo:HandyJSON, ColumnJSONCodable {
    var id:Int? // 用户ID
    var customer_reg_source:String?
    var sts:Int?
    var chat_count:Int?
    var image_count:Int?
    var score:Int?
    var app_channel:String?
    var vip_end_time:String?
    var ad_channel:String?
    var is_vip:Int?
    var vip_start_time:String?
    var oaid:String?
    var update_time:String?
    var wechat_unionid:String?
    var create_time:String?
    var wechat:String?
    var icon:String? // 图标
    var mobile:String?
    var nickname:String?
    var email:String?

}
struct loginTypeModel:HandyJSON, ColumnJSONCodable {
    var voucher_type:String?
    var voucher:String?
    
}
